<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head>
<body>
  <div>
  <input type="button" name="sessionID" value="sessionID"
      onclick="javascript:setMarker()">
	   <input type='text' id='IdForm'/>
	  </div>
  <div id="mapdiv"></div>

  <script src="http://www.openlayers.org/api/OpenLayers.js"></script>
  <script>
	
		map = new OpenLayers.Map("mapdiv");
		map.addLayer(new OpenLayers.Layer.OSM());
    
		
		var allPositions = new OpenLayers.Layer.Text("Alle Positionen",
            { location:"positionMarker?sessionID=",
             projection: "EPSG:4326"
            });
		allPositions
		
		var allStories = new OpenLayers.Layer.Text( "Alle Geschichten",
                    { location:"storyMarker?sessionID=",
                      projection: "EPSG:4326"
                    });
		var allMarker = new OpenLayers.Layer.Text( "Alle POI's",
                    { location:"poiMarker?sessionID=",
                      projection: "EPSG:4326"
                    });
		
		map.addLayer(allPositions);
		map.addLayer(allStories);
		map.addLayer(allMarker);
		
		map.addControl(new OpenLayers.Control.LayerSwitcher({'div':OpenLayers.Util.getElement('layerswitcher')}));
			
		var lonLat = new OpenLayers.LonLat(7.6155807,51.9678512)
			  .transform(
				new OpenLayers.Projection("EPSG:4326"), // transform from WGS 1984
				map.getProjectionObject() // to Spherical Mercator Projection
			  );
		var zoom=14;
		map.setCenter (lonLat, zoom);  
	
	
	
    function setMarker(){ 
		allPositions.setVisibility(false);
		allStories.setVisibility(false);
		allMarker.setVisibility(false);
	
		var sessionId = document.getElementById("IdForm").value;
		
		var positionMarker = new OpenLayers.Layer.Text( sessionId+" Position",
                    { location:"positionMarker?sessionID="+sessionId,
                      projection: "EPSG:4326"
                    });
		
		var storyMarker = new OpenLayers.Layer.Text( sessionId+" Story",
                    { location:"storyMarker?sessionID="+sessionId,
                      projection: "EPSG:4326"
                    });
		var poiMarker = new OpenLayers.Layer.Text( sessionId+" POI",
                    { location:"poiMarker?sessionID="+sessionId,
                      projection: "EPSG:4326"
                    });
		
		map.addLayer(positionMarker);
		map.addLayer(storyMarker);
		map.addLayer(poiMarker);

	}
    
  </script>
  
</body></html>